package servlet;

import java.io.IOException;

import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import service.BorrowService;
import vo.BorrowRetuenBean;

public class BookRetuenCheck extends HttpServlet{
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		// TODO Auto-generated method stub
		req.setCharacterEncoding("utf-8");
		resp.setCharacterEncoding("utf-8");
	String oid=req.getParameter("oid");
	String bid=req.getParameter("bid");
	String bname=req.getParameter("bname");
	bname=new String(bname.getBytes("ISO-8859-1"),"utf-8");
	String rid=req.getParameter("rid");
	String rname=req.getParameter("rname");
	rname=new String(rname.getBytes("ISO-8859-1"),"utf-8");
	String outday=req.getParameter("outday");
	String outtime=req.getParameter("outtime");
	String endouttime=req.getParameter("endouttime");
	BorrowService bs=new BorrowService();
	List<BorrowRetuenBean> list = bs.searchReturnBook(oid, bid, bname, rid, rname, outday, outtime, endouttime);
	req.setAttribute("borrows", list);
	req.getRequestDispatcher("/jsp/returnBook.jsp").forward(req, resp);
	}
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		// TODO Auto-generated method stub
		doGet(req, resp);
	}
}
